<?php

namespace App\Kuafu\WaiMai\Model;

use App\Kuafu\Base\Model\BaseModel;
use App\Kuafu\Base\Model\Traits\KfSoftDeletes;
use App\Kuafu\Base\Model\Traits\KfSplitRelation;
use App\Kuafu\Base\Model\Traits\KfWaiMaiSplit;

class WaiMaiPartRefundLogModel extends BaseModel
{
    use KfWaiMaiSplit;
    use KfSplitRelation;
    use KfSoftDeletes;

    protected $connection = 'mysqlWaiMai';
    protected $table      = 'waimai_part_refund_logs'; //表名
    protected $fillable   = [
        'orderId',
        'shopId',
        'callbackId',
        'originalPrice',
        'payPrice',
        'expectIncome',
        'packingPrice',
    ];

    public static function add(
        int $shopId,
        int $orderId,
        $callbackId,
        int $originalPrice,
        int $payPrice,
        int $expectIncome,
        int $packingPrice
    ) {
        return self::query()->create([
            'orderId'       => $orderId,
            'shopId'        => $shopId,
            'callbackId'    => $callbackId,
            'originalPrice' => $originalPrice,
            'payPrice'      => $payPrice,
            'expectIncome'  => $expectIncome,
            'packingPrice'  => $packingPrice,
        ]);
    }
}
